package com.itheima;

import com.itheima.domain.User;
import com.itheima.service.UserService;
import com.itheima.util.SpringApplicationContext;
import org.dom4j.Document;
import org.dom4j.Element;
import org.dom4j.io.SAXReader;

import java.util.List;

public class App {
    public static void main(String[] args) throws Exception {
        // 1.创建SpringApplicationContext对象
        SpringApplicationContext sac = new SpringApplicationContext("beans.xml");
        // 2.获取bean对象
        UserService userService = (UserService) sac.getBean("userService");
        // 3.调用方法
        User user = userService.findUser();
        // 打印结果
        System.out.println("查询到的用户信息为: " + user);

    }
}

